#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

  struct TreeNode {
      int val;
      TreeNode *left;
      TreeNode *right;
      TreeNode(int x) : val(x), left(NULL), right(NULL) {}
  };

bool isSymmertric(TreeNode *left, TreeNode *right)
{
    if (!left && !right) return true;
    if (!left || !right) return false;
    return left->val == right->val && isSymmertric(left->right, right->left) && isSymmertric(left->left, right->right);
}
//test in 1337 code and pass all the test
class Solution {
public:
    bool isSymmetric(TreeNode *root) {
       if (!root) return true;
       return isSymmertric(root->left, root->right); 
    }
};

int main(int argc, char **argv)
{

}
